﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using KPIS.GERP.GIMS.BLL;
using KPIS.GERP.GIMS.IBLL;
using KPIS.GERP.GIMS.MODEL;

namespace KPIS.GERP.GIMS.APP.APP_UI.UserControl
{
    public partial class ICM_PPR_RouteHistoryApprove : System.Web.UI.UserControl
    {
        ProgressPrePurchaseRequestBLL bllPpr = new ProgressPrePurchaseRequestBLL();

        protected void Page_Load(object sender, EventArgs e)
        {
                int Seq = Convert.ToInt32(Session["HisSeq"].ToString());
                LoadGridApproveHistory(Seq);
        }

        protected void LoadGridApproveHistory(int seq)
        {
            IList<PrePurchaseRequestRouteHistoryInfo> InfoPprRouteHisList = bllPpr.GetPrePurchaseRequestApproveHistory(seq);
            GridHistory.DataSource = InfoPprRouteHisList;

            GridGroupByExpression g;
            GridHistory.MasterTableView.GroupByExpressions.Clear();
            g = new GridGroupByExpression(GridHistory.Columns[0]);
            GridHistory.MasterTableView.GroupByExpressions.Add(g);

            GridHistory.Columns[0].Visible = false;
            GridHistory.DataBind();
        }

        protected void GridHistory_ItemCommand(object source, GridCommandEventArgs e)
        {
            int Seq = Convert.ToInt32(Session["HisSeq"].ToString());
            LoadGridApproveHistory(Seq);
        }
    }
}